package com.yilin.tms.core.entity.user.organize;


import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yilin.tms.core.commons.base.BaseEntity;
import com.yilin.tms.core.entity.user.UserType;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * 合作关系表
 * */
@Entity
@Table(name = "user_cooperate")
@TableName("user_cooperate")
public class Cooperate extends BaseEntity {

    public enum CooperateState{
        none(0,"未合作"),//未合作/已取消合作
        applying(1,"发起中"),//申请中
        cooperate(2,"合作中");//合作中
        @EnumValue
        public Integer index;
        public String name;
        CooperateState(int index,String name){
            this.index = index;
            this.name = name;
        }
    }

    @Column(name = "shipper_organize_id")
    private String shipperOrganizeId;//合作货主组织
    @Column(name = "shipper_organize_name")
    private String shipperOrganizeName;//合作货主组织
    @Column(name = "shipper_organize_logo")
    private String shipperOrganizeLogo;//合作货主LOGO

    @Column(name = "trucker_organize_id")
    private String truckerOrganizeId;//合作车主组织
    @Column(name = "trucker_organize_name")
    private String truckerOrganizeName;//合作车主组织
    @Column(name = "trucker_organize_logo")
    private String truckerOrganizeLogo;//合作车主LOGO

    @Column(name = "initiator_user_id")
    private String initiatorUserId;//合作发起人
    @Column(name = "initiator_user_name")
    private String initiatorUserName;//合作发起人
    @Column(name = "initiator_user_type")
    private UserType initiatorUserType;//合作发起人

    @Column(name = "agreement_user_id")
    private String agreementUserId;//合作协定人
    @Column(name = "agreement_user_name")
    private String agreementUserName;//合作协定人

    @Column(name = "cooperate_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date cooperateTime = new Date();

    @Column(name = "cooperate_state")
    private CooperateState cooperateState;//合作状态


    public String getShipperOrganizeLogo() {
        return shipperOrganizeLogo;
    }

    public void setShipperOrganizeLogo(String shipperOrganizeLogo) {
        this.shipperOrganizeLogo = shipperOrganizeLogo;
    }

    public String getTruckerOrganizeLogo() {
        return truckerOrganizeLogo;
    }

    public void setTruckerOrganizeLogo(String truckerOrganizeLogo) {
        this.truckerOrganizeLogo = truckerOrganizeLogo;
    }

    public UserType getInitiatorUserType() {
        return initiatorUserType;
    }

    public void setInitiatorUserType(UserType initiatorUserType) {
        this.initiatorUserType = initiatorUserType;
    }

    public String getShipperOrganizeName() {
        return shipperOrganizeName;
    }

    public void setShipperOrganizeName(String shipperOrganizeName) {
        this.shipperOrganizeName = shipperOrganizeName;
    }

    public String getTruckerOrganizeName() {
        return truckerOrganizeName;
    }

    public void setTruckerOrganizeName(String truckerOrganizeName) {
        this.truckerOrganizeName = truckerOrganizeName;
    }

    public String getInitiatorUserName() {
        return initiatorUserName;
    }

    public void setInitiatorUserName(String initiatorUserName) {
        this.initiatorUserName = initiatorUserName;
    }

    public String getAgreementUserName() {
        return agreementUserName;
    }

    public void setAgreementUserName(String agreementUserName) {
        this.agreementUserName = agreementUserName;
    }

    public Date getCooperateTime() {
        return cooperateTime;
    }

    public void setCooperateTime(Date cooperateTime) {
        this.cooperateTime = cooperateTime;
    }

    public CooperateState getCooperateState() {
        return cooperateState;
    }

    public void setCooperateState(CooperateState cooperateState) {
        this.cooperateState = cooperateState;
    }

    public String getShipperOrganizeId() {
        return shipperOrganizeId;
    }

    public void setShipperOrganizeId(String shipperOrganizeId) {
        this.shipperOrganizeId = shipperOrganizeId;
    }

    public String getTruckerOrganizeId() {
        return truckerOrganizeId;
    }

    public void setTruckerOrganizeId(String truckerOrganizeId) {
        this.truckerOrganizeId = truckerOrganizeId;
    }

    public String getInitiatorUserId() {
        return initiatorUserId;
    }

    public void setInitiatorUserId(String initiatorUserId) {
        this.initiatorUserId = initiatorUserId;
    }

    public String getAgreementUserId() {
        return agreementUserId;
    }

    public void setAgreementUserId(String agreementUserId) {
        this.agreementUserId = agreementUserId;
    }
}
